//引入工具函数
import request from '@/utils/request'
//添加商品分类成功
export const goodsAddcate = data =>{
  return request ({
    method:'post',
    url:'/goods/addcate',
    data
  })
}

//获取分类列表 
export const goodsCatelist = params =>{
    return request({
        method:'get',
        url:'/goods/catelist',
        params
    })
}

//删除分类
export const goodsDelcate = params =>{
    return request({
        method:'get',
        url:'/goods/delcate',
        params
    })
}

//修改分类
export const goodsEditcate = data =>{
    return request({
        method:'post',
        url:'/goods/editcate',
        data
    })
}

//获取商品列表
export const goodsList = params =>{
    return request({
        method:'get',
        url:'/goods/list',
        params
    })
}

//添加商品
export const goods_Add = data =>{
    return request({
        method:'post',
        url:'/goods/add',
        data
    })
}

//商品图片上传接口 /goods/goods_img_upload
export const goodsImgUpload = data =>{
    return request({
        method:'post',
        url:'/goods/goods_img_upload',
        data
    })
}

//商品分类
export const goodsCategories = params =>{
    return request({
        method:"get",
        url:"/goods/categories",
        params
    })
}